package ClassSecond;

public class Point {
	private int x;
	private int y;
	
	public Point() {
		this.x=0;
		this.y=0;
	}
	public Point(int x,int y) {
		this.x=x;
		this.y=y;
	}
	public Point(int x) {
		this.x=x;
		this.y=x;
	}
	public int getX(Point p) {
		return p.x;
	}
	public int getY(Point p) {
		return p.y;
	}
	public double distance() {
		return Math.sqrt(Math.pow(this.x,2)+Math.pow(this.y,2));
	}
	public double distance(int x,int y) {
		return Math.sqrt(Math.pow(this.x-x,2)+Math.pow(this.y-y,2));
	}
	public double distance(Point other) {
		return Math.sqrt(Math.pow(this.x-other.x,2)+Math.pow(this.y-other.y,2));
	}
}
